<template>
	<view class="user">
		<view class="list">
			<view @click="bindFl" class="list-item">
				分类管理
			</view>
			<view @click="bindGl" class="list-item">
				壁纸管理
			</view>
			<view @click="bindAdd" class="list-item">
				添加壁纸
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			};
		},
		onLoad() {
			this.juUser()
		},
		methods:{
			juUser(){
				const open = uni.getStorageSync('open')
				const db = uniCloud.database();
				db.collection('bz-boss').where({
					openid:open
				}).get()
				.then(res=>{
					console.log(res.result.data.length,'返回结果')
					const lg = res.result.data.length
					if(lg==0){
						uni.reLaunch({
							url:'/pages/index/index'
						})
					}
				})
			},
			bindFl(){
				uni.navigateTo({
					url:'/pages/bz-fl/bz-fl'
				})
			},
			bindGl(){
				uni.navigateTo({
					url:'/pages/img-list/img-list'
				})
			},
			bindAdd(){
				uni.navigateTo({
					url:'/pages/img-add/img-add'
				})
			}
		}
	}
</script>

<style lang="scss">
		.user{
			padding: 15rpx;
			.list{
				.list-item{
					margin: 0 auto;
					margin-top: 10rpx;
					padding: 15rpx 0;
					width: 480rpx;
					border-radius: 10rpx;
					border: 3rpx solid #ababab;
					text-align: center;
				}
			}
		}
</style>
